OBJS = head.o main.o ../kernel/kernel.o ../lib/klib.o ../modules/modules.o 
CFLAGS = -m64 -I../include/ -Wall -Werror -g 


head.o: head.S
	gcc -E -I../include/ head.S > head.s 
	as --64 head.s -o head.o 


%.o: %.c
	gcc -c $*.c $(CFLAGS)

rawkbin: $(OBJS)
	ld -o vmxnix $(OBJS) -T ../kernel.lds -z muldefs 
	objcopy -I elf32-i386 -S -R ".comment" -R ".eh_frame" -O binary vmxnix rawkbin 


.PHONY clean: 
	rm $(OBJS) vmxnix rawkbin head.s -f 

